Any object which is defined with class Person will contain integer instance variables representing age and weight. The only procedures which act on this data are: setting the values and printing the values. These methods may be defined by:
Person::set()
{
age = 28;
weight = 150;
}
Person::print()
{
printf("%d ",age);
printf("%d",weight);
}
('printf()' is a standard C library function discussed in the next section.)